/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.utils;

import com.intelligent.ispc.common.utils.Reflections;
import com.intelligent.ispc.core.dto.DataDictionaryDto;

import java.util.List;

/**
 * Created by Peter.Li on 2015/10/30.
 */
public class DataDictionaryReflectUtil {

    public static Object copyAttribute2Object(List<DataDictionaryDto> dtos, Object object) {
        for (DataDictionaryDto dto : dtos) {
            Reflections.setFieldValueWithFieldClass(object, dto.getAttributeName(), dto.getAttributeValue());
        }

        return object;
    }
}
